package smetana.domain.raw;

import java.sql.Date;
import java.math.BigDecimal;
import com.google.common.base.Preconditions;
import smetana.domain.AbstractEntity;

import static org.apache.commons.lang.StringUtils.defaultString;

public class Position  extends AbstractEntity {
    private int id;
    private Date dateStart;
    private Date dateEnd;
    private int positionTypeId;
    private Integer positionGroupId;
    private int positionUnitId;
    private String positionName;
    private BigDecimal price;

    protected Position(){
        //used by iBatis.
    }

    public Position(int id){
        this.id = id;
    }

    @Override
    public int getId(){
        return this.id;
    }

    public void setId(int id){
        this.id = id;
    }
    public Date getDateStart(){
        return this.dateStart;
    }

    public void setDateStart(Date dateStart){
        this.dateStart = Preconditions.checkNotNull(dateStart);
    }
    public Date getDateEnd(){
        return this.dateEnd;
    }

    public void setDateEnd(Date dateEnd){
        this.dateEnd = Preconditions.checkNotNull(dateEnd);
    }
    public int getPositionTypeId(){
        return this.positionTypeId;
    }

    public void setPositionTypeId(int positionTypeId){
        this.positionTypeId = positionTypeId;
    }
    public Integer getPositionGroupId(){
        return this.positionGroupId;
    }

    public void setPositionGroupId(Integer positionGroupId){
        this.positionGroupId = positionGroupId;
    }
    public int getPositionUnitId(){
        return this.positionUnitId;
    }

    public void setPositionUnitId(int positionUnitId){
        this.positionUnitId = positionUnitId;
    }
    public String getPositionName(){
        return defaultString(this.positionName);
    }

    public void setPositionName(String positionName){
        this.positionName = Preconditions.checkNotNull(positionName);
    }
    public BigDecimal getPrice(){
        return this.price;
    }

    public void setPrice(BigDecimal price){
        this.price = Preconditions.checkNotNull(price);
    }
}